package class4;

import java.io.*;

public class demo4 {
    public static void main(String[] args) throws IOException {
        FileInputStream reader=new FileInputStream("test.txt");
        InputStreamReader reader1=new InputStreamReader(reader);
        BufferedReader br=new BufferedReader(reader1);

        FileOutputStream outputStream=new FileOutputStream("writer.txt");
        OutputStreamWriter writer=new OutputStreamWriter(outputStream);
        BufferedWriter bw=new BufferedWriter(writer);

        String line;
        while ((line=br.readLine())!=null){
            bw.write(line);
        }
        bw.close();
        br.close();
    }
}
